<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;

Route::get('/admin', fn() => \Slowlyo\OwlAdmin\Admin::view());

Route::group([
    'domain'     => config('admin.route.domain'),
    'prefix'     => config('admin.route.prefix'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {
    $router->resource('dashboard', \App\Admin\Controllers\HomeController::class);
    $router->resource('system/settings', \App\Admin\Controllers\SettingController::class);
    $router->get('/tools/flowscheck', [\App\Admin\Controllers\ToolsController::class, 'flowDataCorrection']);
    $router->post('/tools/flow-data-correction',  [\App\Admin\Controllers\ToolsController::class, 'handleFlowDataCorrection']);
    $router->get('/tools/download-processed-file', [\App\Admin\Controllers\ToolsController::class, 'downloadProcessedFile']);
    
    // 流量图表相关路由
    $router->get('/tools/flow-charts', [\App\Admin\Controllers\ToolsController::class, 'flowDataCharts']);
    $router->post('/tools/flow-charts/upload', [\App\Admin\Controllers\ToolsController::class, 'handleFlowChartsUpload']);
    $router->get('/tools/flow-charts/data', [\App\Admin\Controllers\ToolsController::class, 'getFlowChartsData']);
    $router->get('/tools/get_days_of_month', [\App\Admin\Controllers\ToolsController::class, 'getDaysOfMonth']);
 
});
